package zhou.cutfruit;

import zhou.cutfruit.util.PreparedSoundSingle;
import zhou.cutfruit.view.MyLinearlayoutView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class FruitActivity extends Activity {

	MyLinearlayoutView myLinearlayout;// 自定义控件

	Button button;//开始游戏按钮

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//设置无标题
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		//设置全屏
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		//非常关键，初始化带参数的单例模式，准备音效
		PreparedSoundSingle.StartInstance(FruitActivity.this);

		setContentView(R.layout.main);


		myLinearlayout = (MyLinearlayoutView) findViewById(R.id.ll_my);

		button = (Button) findViewById(R.id.button1);

		//点击跳转至游戏界面
		button.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(FruitActivity.this,
						GameViewActivity.class);
				startActivity(intent);

			}
		});

	}

}